package com.gaia.member.gaiatt.mygaia;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;

import com.gaia.member.gaiatt.R;
import com.gaia.member.gaiatt.mygaia.bean.OrderBean;

import java.util.ArrayList;
import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;

public class UncommentOrderActivity extends AppCompatActivity {

    @Bind(R.id.lv_uncomment_order)
    ListView lvUncommentOrder;
    @Bind(R.id.tv_title_title_bar)
    TextView tvTitleTitleBar;


    UncommentOrderAdapter uncommentOrderAdapter;
    List<OrderBean> orderList = new ArrayList<>();

    Activity mContext;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mContext = this;
        setContentView(R.layout.activity_uncomment_order);
        ButterKnife.bind(this);


        tvTitleTitleBar.setText("待评价订单");
        for (int i = 0; i < 30; i++) {
            OrderBean orderBean = new OrderBean();
            orderList.add(orderBean);
        }
        uncommentOrderAdapter = new UncommentOrderAdapter(mContext,0, orderList);
        lvUncommentOrder.setAdapter(uncommentOrderAdapter);

    }


    class UncommentOrderAdapter extends ArrayAdapter<OrderBean> {
        Context context;

        public UncommentOrderAdapter(Context context, int resource, List<OrderBean> objects) {
            super(context, resource, objects);
            this.context = context;
        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            if (convertView == null) {
                convertView = View.inflate(context, R.layout.item_list_mygaia_uncomment_order, null);
            }

            return convertView;
        }
    }


}
